#ifndef __OSLIB_PLUS_WIFI_AT_H
#define __OSLIB_PLUS_WIFI_AT_H

#include "oslib_plus_config.h"
/* ESP8266/E103-W05 AT指令 */

#define wifi_huart huart1
#define wifi_uart_rxsema UART1_RxSema
#define wifi_uart_rxbuf UART1_TaskBuffer

#define WIFI_ROLE_AP    0
#define WIFI_ROLE_STA   1

/* 其他任务向GateKeeper任务发送的指令 */
// #define WIFI_AT_MODE_REPEAT          0
// #define WIFI_AT_MODE_CONSISTENCY     1
// typedef struct {
//     char * request;
//     char * waitfor;
//     uint8_t mode;
// } ATCmd_t;

/* 针对单连接模式 */
// void OSLIB_PLUS_Wifi_UDP_Connect(UART_HandleTypeDef *huart, const char *remote_ip, uint16_t remote_port, uint16_t local_port);
// void OSLIB_PLUS_Wifi_UDP_SendData(UART_HandleTypeDef *huart, uint8_t *data, uint32_t length);

extern int AT_APSTA_Connect(void);
extern int AT_UDP_Connect(const char *remote_ip, uint16_t remote_port, uint16_t local_port);
extern int AT_UDP_SendData(uint8_t *data, uint32_t length);

#endif /* !__OSLIB_PLUS_WIFI_AT_H */
